#include <stdio.h>
#include <stdlib.h>
void main()
{	int s=0;
	int i, j, k;
	int x[6];
	for (i = 0; i < 1000000; i++) 
	{
		
        for (k = i, j = 0; j < 6; j++, k /= 10) 
		{
            x[j] = k % 10;
		}

        if (x[0]+x[1]+x[2] == x[3]+x[4]+x[5]) 
		{
            ++s;
		}
	}
printf ("kolichestvo biletov:%d\n",s);
system ("PAUSE");
}
